Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR3: Adding abstract class corresponding to OpenCvVisualizer3D and making other relevant changes #4

Open
wants to merge 3 commits into
base: xcomp_refactor/add_colorutils
Choose a base branch
from

Conversation

sarika93
Copy link
Member

@sarika93 sarika93 commented Dec 12, 2024

This is the third PR in a series of changes that aim to make building with the visualizer module optional and remove the cv::viz dependency from other modules. A key feature of this change is to utilize abstract classes to add dummy visualizer classes with stubbed out functions. These dummy classes can then be utilized when building without the visualizer. This change focuses on adding the BaseOpenCvVisualizer abstract class and updating OpenCvVisualizer3D to be derived from it. This class is used by MeshOptimization and EurocPlayground. The dummy class is not yet included, to simplify the PR.

Changes include:

  • Adding BaseOpenCvVisualizer3D abstract class
  • Updating OpenCvVisualizer3D to override relevant functions and be derived from abstract class
  • Updating all non-visualizer classes using OpenCvVisualizer3D to reference the abstract class instead.

The follow up PR will have all other abstract classes, but submitting this one first to make sure the format of changes are reasonable.

Full design document can be found here.
Visualization Build Option Refactor for Kimera-VIO.pdf

Testing process
Build docker container for testing

  • Navigate to Kimera-VIO/scripts/Docker
  • Modify the Dockerfile to get the relevant testing branch instead of master. Change line 85 to the following:
RUN git clone https://github.com/Virtana/Kimera-VIO.git && git checkout origin/<branch_name>
  • Build and run the image:
./kimera_vio_docker.bash

Testing

  1. Update Kimera-VIO to generate logs:
    1. For stereo: Open Kimera-VIO/params/Euroc/flags/stereoVIOEuroc.flags with your editor of choice and modify -- log_output to true.
    2. For mono:
      1. Open Kimera-VIO/params/EurocMono/flags/stereoVIOEuroc.flags and modify -- log_output to true.
      2. Open Kimera-VIO/params/EurocMono/BackendParams.yaml with the following changes:
        • linearizationMode: 1
      3. Open Kimera-VIO/params/EurocMono/FrontendParams.yaml with the following changes:
        • maxFeatureAge: 15
        • feature_detector_type: 0
        • maxFeaturesPerFrame: 200
      4. Open Kimera-VIO/script/stereoVIOEuroc.bash and change the LOG_OUTPUT variable from 0 to 1.
  2. Run Kimera-VIO: ./stereoVIOEuroc.bash.
  3. You can examine output logs in Kimera-VIO/output_logs/ to ensure the values in traj_gt.csv are the same as the version on master. You can re-run after checking out to master and rebuilding and installing:
git checkout master
rm -r build && mkdir build
cd build
cmake .. && make -j4 install

Then re-run Kimera-VIO as shown in step 2. You should be re-running with the same configuration options.

You should also be looking out for any differences in the visualizer behaviour.

@@ -51,7 +51,7 @@ class MeshOptimization {
MeshOptimization(const MeshOptimizerType& solver_type,
const MeshColorType& mesh_color_type,
Camera::ConstPtr camera,
OpenCvVisualizer3D::Ptr visualizer = nullptr);
std::shared_ptr<VIO::BaseOpenCvVisualizer3D> visualizer = nullptr);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about format of the this, per Google C++ styleguide.

@@ -50,7 +50,7 @@ constexpr float MeshOptimization::kMaxZ;
MeshOptimization::MeshOptimization(const MeshOptimizerType& solver_type,
const MeshColorType& mesh_color_type,
Camera::ConstPtr camera,
OpenCvVisualizer3D::Ptr visualizer)
std::shared_ptr<VIO::BaseOpenCvVisualizer3D> visualizer)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about format of the this, per Google C++ styleguide.

@sarika93 sarika93 requested review from vpradeep07 and shiv1994 and removed request for vpradeep07, shiv1994 and enrique-ramkissoon January 6, 2025 18:53
@sarika93 sarika93 changed the title Adding abstract class corresponding to OpenCvVisualizer3D and making other relevant changes PR3: Adding abstract class corresponding to OpenCvVisualizer3D and making other relevant changes Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant